﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Directory.Web;

public partial class Admin_unauditeditemview : System.Web.UI.Page
{
	protected int categoryId;
	protected int pageIndex;
	protected int pageSize = WebSettings.GetInstance().UncheckedItemsPageSize;
	protected int totalRecords;
	protected string pageKey = "page";
	protected string categoryIdKey = "categoryId";
	protected Directory.Model.CategoryInfo cat;

	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.User.Identity.IsAuthenticated)
		{
			Response.End();
			return;
		}
		if (!int.TryParse(Request.QueryString[pageKey], out pageIndex))
		{
			pageIndex = 0;
		}

		cat = CategoryDataProxy.GetCategory(categoryId);

		if (!IsPostBack)
		{
			rptItems.DataSource = ItemDataProxy.GetUncheckedItems4User(Page.User.Identity.Name, pageIndex, pageSize, out totalRecords);
			rptItems.DataBind();

			this.PageBreak.PageIndex = pageIndex;
			this.PageBreak.PageKey = pageKey;
			this.PageBreak.PageSize = pageSize;
			this.PageBreak.TotalRecords = totalRecords;
			this.PageBreak.NavigatorUrl = Request.Url.AbsolutePath + "?" + categoryIdKey + "=" + categoryId.ToString() + "&";
		}
	}
}
